cmake_minimum_required(VERSION 2.8)
project(libfacerecognizer)

#use opencv
set(OpenCV_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/opencv330-dev/)
find_package(OpenCV)
include_directories(${OpenCV_INCLUDE_DIRS})

#CUDA
include_directories($ENV{CUDA_PATH_V8_0}/include)
link_directories($ENV{CUDA_PATH_V8_0}/lib/x64)

#CUDNN
set(CUDNN_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/cudnn)
include_directories(${CUDNN_DIR}/include)
link_directories(${CUDNN_DIR}/lib/x64)

#Caffe
include(${CMAKE_CURRENT_LIST_DIR}/../../cmake/mini-caffe.cmake)

file(GLOB_RECURSE srcs src/*.cpp)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
                    ${CMAKE_CURRENT_SOURCE_DIR}/include)

set(BUILD_STATIC_LIBS ON)
add_library(libfacerecognizer ${srcs})
set(LIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../3rdparty/mini-caffe/lib)
target_link_libraries(libfacerecognizer ${LIB_PATH}/caffe.lib )

add_executable(test ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
target_link_libraries(test libfacerecognizer ${OpenCV_LIBS} 
${LIB_PATH}/libopenblas.lib
${LIB_PATH}/libprotobuf.lib
$ENV{CUDA_PATH_V8_0}/lib/x64/cudart.lib)